﻿using CPPEI.Coolzon.Data;
using CPPEI.Coolzon.Data.MainServiceData;
using CPPEI.Coolzon.Service.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.Service
{
    /// <summary>
    /// 主服务的回调契约
    /// </summary>
    [ServiceContract]
    public interface IMainServiceCallback
    {
        /// <summary>
        /// 有用户进入了控制域
        /// </summary>
        /// <param name="controlDomain">控制域</param>
        /// <param name="user">用户信息</param>
        [OperationContract]
        void UserEnterControlDomain(string controlDomain, UserInfo user);

        /// <summary>
        /// 接收到来自服务器的回应
        /// </summary>
        /// <param name="header"></param>
        /// <param name="content"></param>
        [OperationContract(IsOneWay = true)]
        void OnReceiveResponse(Response response);

        /// <summary>
        /// 测试连接状态
        /// </summary>
        [OperationContract]
        ConnectionState TestConnectionState();

        /// <summary>
        /// 获取视图状态
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        QueryViewStateResult QueryViewState();

        [OperationContract(IsOneWay = true)]
        void TestConnection();
    }
}
